package com.example.stringbufferlogger.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.stringbufferlogger.entity.InterfaceMappingConfig;
import com.example.stringbufferlogger.mapper.InterfaceMappingConfigMapper;
import com.example.stringbufferlogger.service.InterfaceMappingConfigService;
import org.springframework.stereotype.Service;

@Service
public class InterfaceMappingConfigServiceImpl extends ServiceImpl<InterfaceMappingConfigMapper, InterfaceMappingConfig> implements InterfaceMappingConfigService {
    @Override
    public InterfaceMappingConfig getNewPath(String id) {
        QueryWrapper<InterfaceMappingConfig> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("id", id);
        return this.getOne(queryWrapper);
    }
    @Override
    public InterfaceMappingConfig getByInterfaceUrl(String interfaceUrl) {
        return baseMapper.selectByInterfaceUrl(interfaceUrl);
    }

    @Override
    public String getByOldpath(String interfaceUrl) {
        return baseMapper.selectByOldpath(interfaceUrl);
    }
}
